#include "gl.hh"
#include "../platform/gl.hh"
#include "../utils/journal.hh"
#include <stdexcept>

namespace ngintoy
{
    namespace renderer
    {
        namespace {
            using jn = utils::journal;
        }

        gl::gl(config &, platform & plat)
            : gl_plat{static_cast<gl_platform &>(plat)}
        {
            jn::begin() << "gl renderer (base)";
            if (!dynamic_cast<gl_platform *>(&plat))
                throw std::runtime_error{
                    "gl renderer can only run on gl platform"};
        }

        gl::~gl()
        {
            jn::end() << "gl renderer (base)";
        }
    }
}

